import request from '@/utils/request'

// 查询客户列表
export function listCustomerinfo(query) {
  return request({
    url: '/CustomerinfoMain/customerinfo/list',
    method: 'get',
    params: query
  })
}

export function listoutCustomerinfo(query) {
  return request({
    url: '/CustomerinfoMain/customerinfo/listout',
    method: 'get',
    params: query
  })
}

// 查询客户消费排行列表
export function listCustomerinfoph(query) {
  return request({
    url: '/CustomerinfoMain/customerinfo/listph',
    method: 'get',
    params: query
  })
}
// 查询下级经销商客户列表
export function listCustomerinfoa(query) {
  return request({
    url: '/CustomerinfoMain/customerinfo/lista',
    method: 'get',
    params: query
  })
}
// 查询客户详细
export function getCustomerinfo(customerId) {
  return request({
    url: '/CustomerinfoMain/customerinfo/' + customerId,
    method: 'get'
  })
}
//  分配用户
export function selectyh(data) {
  return request({
    url: '/CustomerinfoMain/customerinfo/selectyh',
    method: 'get',
    params: data
  })
}
//  分配用户-技术员
export function selectyhjs(data) {
  return request({
    url: '/CustomerinfoMain/customerinfo/selectyhjs',
    method: 'get',
    params: data
  })
}
//  批量分配用户
export function selectyhs(data) {
  return request({
    url: '/CustomerinfoMain/customerinfo/selectyhs',
    method: 'get',
    params: data
  })
}
// 修改实际渠道
export function updateqd(data) {
  return request({
    url: '/CustomerinfoMain/customerinfo/updateqd',
    method: 'get',
    params: data
  })
}
// 同步客户
 export function tblistCustomerinfo(query) {
  return request({
    url: '/CustomerinfoMain/customerinfo/tblistCustomerinfo',
    method: 'put',
 
  })
}

// 同步客户对应业务员
export function tblistCustomerinfoywy(query) {
  return request({
    url: '/CustomerinfoMain/customerinfo/tblistCustomerinfoywy',
    method: 'get',
 
  })
}

// 新增客户
export function addCustomerinfo(data) {
  return request({
    url: '/CustomerinfoMain/customerinfo',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateCustomerinfo(data) {
  return request({
    url: '/CustomerinfoMain/customerinfo',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delCustomerinfo(customerId) {
  return request({
    url: '/CustomerinfoMain/customerinfo/' + customerId,
    method: 'delete'
  })
}
